package com.iv.durian.cloud.facade;


import com.iv.durian.cloud.Notify;
import com.iv.durian.cloud.Serve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(name = Serve.SERVICE_NAME)
@RequestMapping("/service/notify")
public interface NotifyFacade {

    @RequestMapping(path = "/get/{notifyId}", method = RequestMethod.GET)
    Notify get(@PathVariable(value = "notifyId") Integer notifyId);

    @RequestMapping(path = "/add", method = RequestMethod.POST)
    void add(@RequestBody Notify notify);

    @RequestMapping(path = "/update", method = RequestMethod.POST)
    void update(@RequestBody Notify notify);

    @RequestMapping(path = "/remove/{notifyId}", method = RequestMethod.POST)
    int remove(@PathVariable("notifyId") Integer notifyId);

    @RequestMapping(path = "/list", method = RequestMethod.POST)
    List<Notify> list(@RequestParam(value = "userId", required = false) Integer userId,
                      @RequestParam(value = "status", required = false) Integer status,
                      @RequestParam(value = "type", required = false) Integer type,
                      @RequestParam(value = "offset", required = false) Integer offset,
                      @RequestParam(value = "limit", required = false) Integer limit);

    @RequestMapping(path = "/count", method = RequestMethod.POST)
    int count(@RequestBody Notify notify);
}
